{extend name='admin@public/content'}

{block name="content"}
<form autocomplete="off" onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='form-horizontal layui-form padding-top-20'>

    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <ul class="layui-tab-title">
            <li class="layui-this">基本信息</li>
            <li>询价信息</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <div class="form-group">
                    <label class="col-sm-2 control-label">物品分类</label>
                    <div class='col-sm-8'>
                        {volist name="supplierCates" id="goodsType"}
                        <label class="think-checkbox">
                            <input lay-ignore class="list-check-box" type="checkbox" value="{$goodsType.id}" name="goods_type_ids[]" {in name="goodsType.id" value="$vo.goods_type_ids"}checked{/in}/> {$goodsType.title}
                        </label>
                        {/volist}
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">信用评级</label>
                    <div class='col-sm-8'>
                        <select name="min_credit">
                            {volist name="credit_arr" id="credit"}
                            <option value="{$credit.credit}" {$credit['credit']==$vo['min_credit']?'selected':''}>{$credit.name}</option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">参与条件</label>
                    <div class='col-sm-8'>
                        <label class="think-checkbox">
                            <input lay-ignore class="list-check-box" type="checkbox" value="1" name="auth[]" {in name="1" value="$vo.auth"}checked{/in}/> 超级会员
                        </label>
                        <label class="think-checkbox">
                            <input lay-ignore class="list-check-box" type="checkbox" value="4" name="auth[]" {in name="4" value="$vo.auth"}checked{/in}/> 保证金认证
                        </label>
                        <label class="think-checkbox">
                            <input lay-ignore class="list-check-box" type="checkbox" value="5" name="auth[]" {in name="5" value="$vo.auth"}checked{/in}/> 实名认证
                        </label>
                        <label class="think-checkbox">
                            <input lay-ignore class="list-check-box" type="checkbox" value="6" name="auth[]" {in name="6" value="$vo.auth"}checked{/in}/> 实地认证
                        </label>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">其他</label>
                    <div class='col-sm-8'>
                        <label class="think-checkbox">
                            <input lay-ignore class="list-check-box" type="checkbox" value="运输" name="attr[]" {in name="'运输'" value="$vo.attr"}checked{/in}/> 运输
                        </label>
                        <label class="think-checkbox">
                            <input lay-ignore class="list-check-box" type="checkbox" value="安装" name="attr[]" {in name="'安装'" value="$vo.attr"}checked{/in}/> 安装
                        </label>
                        <label class="think-checkbox">
                            <input lay-ignore class="list-check-box" type="checkbox" value="专票" name="attr[]" {in name="'专票'" value="$vo.attr"}checked{/in}/> 专票
                        </label>
                        <label class="think-checkbox">
                            <input lay-ignore class="list-check-box" type="checkbox" value="普票" name="attr[]" {in name="'普票'" value="$vo.attr"}checked{/in}/> 普票
                        </label>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">工作描述</label>
                    <div class='col-sm-8'>
                        <textarea name="desc" class="form-control">{$vo.desc|default=''|htmlspecialchars_decode}</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">回价方式</label>
                    <div class='col-sm-8'>
                        <label class="think-checkbox">
                            <input lay-ignore class="list-check-box" type="checkbox" value="电话联系" name="back_type[]" {in name="'电话联系'" value="$vo.back_type"}checked{/in}/> 电话联系
                        </label>
                        <label class="think-checkbox">
                            <input lay-ignore class="list-check-box" type="checkbox" value="平台回复" name="back_type[]" {in name="'平台回复'" value="$vo.back_type"}checked{/in}/> 平台回复
                        </label>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">联系电话</label>
                    <div class='col-sm-8'>
                        <input name="mobile" value="{$vo.mobile}" title="请输入联系电话" placeholder="请输入联系电话" class="layui-input">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">标题</label>
                    <div class='col-sm-8'>
                        <input name="title" value="{$vo.title}" title="请输入标题" placeholder="请输入标题" class="layui-input">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">抢单结束时间</label>
                    <div class='col-sm-8'>
                        <input readonly name="grab_sheet_end_time" value="{$vo.grab_sheet_end_time|date='Y-m-d H:i:s'}" title="请选择抢单结束时间" placeholder="请选择结束时间" class="layui-input js_time_box">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">回价时间（H）</label>
                    <div class='col-sm-8'>
                        <input name="back_hour" value="{$vo.back_hour}" title="请输入回价时间" placeholder="请输入回价时间" class="layui-input">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">VIP抢单积分</label>
                    <div class='col-sm-8'>
                        <input name="vip_money" value="{$vo.vip_money}" title="请输入VIP抢单积分" placeholder="请输入VIP抢单积分" class="layui-input">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">抢单积分</label>
                    <div class='col-sm-8'>
                        <input name="money" value="{$vo.money}" title="请输入抢单积分" placeholder="请输入抢单积分" class="layui-input">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">状态</label>
                    <div class='col-sm-8'>
                        <label class="think-radio"><input lay-ignore type="radio" {$vo['status']=='0'?'checked':''} value="0" name="status"/> 待审核</label>
                        <label class="think-radio"><input lay-ignore type="radio" {$vo['status']=='1'?'checked':''} value="1" name="status"/> 抢单中</label>
                        <label class="think-radio"><input lay-ignore type="radio" {$vo['status']=='2'?'checked':''} value="2" name="status"/> 已结束</label>
                        <label class="think-radio"><input lay-ignore type="radio" {$vo['status']=='3'?'checked':''} value="3" name="status"/> 已成交</label>
                    </div>
                </div>
            </div>
            <div class="layui-tab-item">
                {volist name="vo['quotation_detail']" id="quotation_detail" key="_key"}
                <div class="form-group">
                    <label class="col-sm-2 control-label">第{$_key}项</label>
                    <div class='col-sm-8'>
                        <table class="layui-table background-item margin-none" lay-size="sm" lay-skin="nob">
                            <thead>
                            <tr>
                                <td>主图</td>
                                <td>明细图片</td>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td class="text-top" style="width:100px">
                                    <input type="hidden" class="js_single_image{$_key}" name="qd_image[{$_key}]" value="{$quotation_detail['image']}">
                                </td>
                                <td class="text-top">
                                    <input type="hidden" class="js_mut_image{$_key}" name="qd_images[{$_key}]" value="{$quotation_detail['images']}">
                                </td>
                            </tr>
                            </tbody>
                        </table>
                        <input name="qd_number[{$_key}]" value="{$quotation_detail['number']}" title="请输入数量" placeholder="请输入数量" class="layui-input">
                    </div>
                </div>
                <script>
                    // 单图片上传处理
                    $(".js_single_image{$_key}").uploadOneImage();
                    // 多图片上传处理
                    $(".js_mut_image{$_key}").uploadMultipleImage();
                </script>
                {/volist}
            </div>
        </div>
    </div>

    <div class="hr-line-dashed"></div>

    <div class="col-sm-7 col-sm-offset-2">
        <div class="layui-form-item text-center">
            {if !empty($vo.id)}
            <input type="hidden" name="id" value="{$vo.id}">
            {/if}
            <button class="layui-btn" type="submit">保存</button>
            <button class="layui-btn layui-btn-danger" type='button' onclick="window.history.back()">取消</button>
        </div>
    </div>

    <style>
        .background-item {
            padding: 15px;
            background: #efefef;
        }
        .no_border{border:none;}
        .background-item thead tr {
            background: #e0e0e0
        }
        .layui-form-select,.w30{width: 30%;float: left;}
    </style>
    <script>
        window.form.render();
        layui.use('laydate', function(){
            var laydate = layui.laydate;

            laydate.render({
                elem: 'input.js_time_box',
                btns: ['now', 'confirm'],
                type:'datetime'
            });
        });
    </script>
</form>
{/block}